Carbon


SetFPos

Header: Files.h Carbon status: Supported

Sets the position of the file mark before reading from or writing to an open file.

OSErr SetFPos (
    SInt16 refNum, 
    SInt16 posMode, 
    SInt32 posOff
);
refNum

The file reference number of an open file.

posMode

The positioning mode. The posMode parameter indicates how to position the mark; it must contain one of the values described in “Positioning Mode Constants”.

If you specify fsAtMark, the mark is left wherever it’s currently positioned, and the posOff parameter is ignored. The fsFromStart, fsFromLEOF, and fsFromMark constants let you position the mark relative to either the beginning of the file, the logical end-of-file, or the current mark. If you specify one of these three constants, you must also pass in posOff a byte offset (either positive or negative) from the specified point. If you specify fsFromLEOF, the value in posOff must be less than or equal to 0.

posOff

The positioning offset.

function result

A result code.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)